<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″/>
    <link rel="stylesheet" type="text/css" href="../../css/defaultcss.css" />
    <link rel="stylesheet" type="text/css" href="../../css/amazeui.min.css" />
    <script type="text/javascript" src="../../js/jquery-1.9.1.min.js"></script>
    <script src='../../layer/layer.js'></script>
    <script src='../../js/index.js'></script>
    <script src='../../js/amazeui.min.js'></script>
    <script src='../../js/flex.js'></script>
    <link rel="stylesheet" href="../../css/weui.min.css">
    <link rel="stylesheet" href="../../css/css/stylesheets/index.css">

</head>

<body style='background:#fff'>
    <header>
        <div class="goBack">
            <img src="../../img/base/back.png" alt="返回">
        </div>
        <span class="title"> 青少年维权 </span>
    </header>
    <div class="content  consult_help">
        <ul class="tablist">
            <li class="active">
                <a href="javascript:void(0);">咨询求助</a>
            </li>
            <li>
                <a href="./answer.html">问题回复</a>
            </li>
            <li>
                <a href="./man_list.html">专家风采</a>
            </li>
            <li>
                <a href="./question.html">常见问题</a>
            </li>
        </ul>
        <div class=" application_enquiry feedback">
            <form id="fform">
                <ul class="form_ul">
                    <li>
                        <label for="">姓名</label>
                        <input type="text" name="couName" value="" id="couName" placeholder="">
                    </li>
                    <li>
                        <label for="">联系方式</label>
                        <input type="text" name="couMobile" value="" id="couMobile" placeholder="">
                    </li>
                    <div class="notice">
                        问题详情
                    </div>
                    <div class="option_text">
                        <textarea id='detail' name="detail" onpropertychange="checkIntroLength(this);" oninput="checkIntroLength(this);" placeholder="咨询问题详细描述"></textarea>
                        <div class="num">
                            200
                        </div>
                    </div>
                </ul>
            </form>
            <div class="submitBtn">
                <button class="button" id="submit">
						提交
					</button>
            </div>
        </div>
        <div class="helpTips">
            <p>注：</p>
            青少年维权浦口检察院主办，是帮助青少年解答生活、工作和学习中遇到权益问题和困惑的综合性在线咨询公益服务平台。通过本平台提出的问题将由共青团联系的热心青少年事务的法律工作者、心理工作者在注重隐私保护的前提下提供专业解答。平台可以经提问者同意将问题和答复在去隐私化的情况下发布和使用。专业解答仅代表专家个人观点，不代表本平台观点。专家的解答仅供参考，能否适用还需与提问者的具体实际情况相结合。
        </div>
        <div class="am-modal am-modal-alert radiusModal" tabindex="-1" id="lawsuitModal">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">温馨提示</div>
                <div class="am-modal-bd">
                    所提线索已提交
                    </br>请等待反馈!
                </div>
                <div class="am-modal-footer">
                    <a href='./answer.html' class="am-modal-btn">确定</a>
                </div>
            </div>
        </div>
    </div>

</body>

</html>

<script type="text/javascript ">
    $("#submit").bind('click', function () {
        var isPhoneNum = /^(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])\d{8}$/; // 手机
        var couName = $("#couName").val();
        var couMobile = $("#couMobile").val();
        var detail = $('#detail').val();
        console.log(detail)
        if (couName == "") {
            layer.open({
                title: '提示',
                content: "姓名不能为空！",
                btn: ['确定'],
            });
            return false;
        } else if (couMobile == "") {
            layer.open({
                title: '提示',
                content: "手机号不能为空！",
                btn: ['确定'],
            });
            return false;
        } else if (!isPhoneNum.test(couMobile)) {
            layer.open({
                title: '提示',
                content: "手机号格式有误！",
                btn: ['确定'],
            });
            return false;
        } else if (detail == "") {
            layer.open({
                title: '提示',
                content: "问题不能为空！",
                btn: ['确定'],
            });
            return false;
        }

        var form = new FormData($('#fform')[0]);
        HYIP.ajax({
            url: '/youth/counselSave.action',
            type: 'post',
            processData: false,
            data: form
        }, function (data) {
            $("#lawsuitModal").modal('open');
            $('#lawsuitModal').on('close.modal.amui', function () {
                window.location.href = './answer.html'
            });
        });
        return false;
    })

    $('.goBack').bind('click', function () {
        window.history.back()
    })

    function checkIntroLength(obj) {
        var max = 200;
        if (obj.value.length > max) {
            obj.value = obj.value.substring(0, max);
        }
        $(".option_text .num").text(200 - obj.value.length);
    }
</script>